package com.team1.system.libraryrating.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.team1.system.libraryrating.mapper.LibraryRatingMapper;
import com.team1.system.libraryrating.domain.LibraryRating;
import com.team1.system.libraryrating.service.ILibraryRatingService;

/**
 * 评价管理Service业务层处理
 *
 * @author hyy
 * @date 2023-04-09
 */
@Service
public class LibraryRatingServiceImpl implements ILibraryRatingService
{
    @Autowired
    private LibraryRatingMapper libraryRatingMapper;

    /**
     * 查询评价管理
     *
     * @param userId 评价管理主键
     * @return 评价管理
     */
    @Override
    public LibraryRating selectLibraryRatingByUserId(Long userId)
    {
        return libraryRatingMapper.selectLibraryRatingByUserId(userId);
    }

    /**
     * 查询评价管理
     *
     * @param libraryRating 评价管理联合主键(评价管理)
     * @return 评价管理
     */
    @Override
    public LibraryRating selectLibraryRatingByUserIdBookId(LibraryRating libraryRating)
    {
        return libraryRatingMapper.selectLibraryRatingByUserIdBookId(libraryRating);
    }

    /**
     * 查询评价管理列表
     *
     * @param libraryRating 评价管理
     * @return 评价管理
     */
    @Override
    public List<LibraryRating> selectLibraryRatingList(LibraryRating libraryRating)
    {
        return libraryRatingMapper.selectLibraryRatingList(libraryRating);
    }

    /**
     * 查询评价管理列表
     *
     * @param libraryRating 评价管理
     * @return 评价管理
     */
    @Override
    public List<LibraryRating> selectLibraryRatingTop(LibraryRating libraryRating)
    {
        return libraryRatingMapper.selectLibraryRatingTop(libraryRating);
    }

    /**
     * 新增评价管理
     *
     * @param libraryRating 评价管理
     * @return 结果
     */
    @Override
    public int insertLibraryRating(LibraryRating libraryRating)
    {
        return libraryRatingMapper.insertLibraryRating(libraryRating);
    }

    /**
     * 修改评价管理
     *
     * @param libraryRating 评价管理
     * @return 结果
     */
    @Override
    public int updateLibraryRating(LibraryRating libraryRating)
    {
        return libraryRatingMapper.updateLibraryRating(libraryRating);
    }

    /**
     * 批量删除评价管理
     *
     * @param userIds 需要删除的评价管理主键
     * @return 结果
     */
    @Override
    public int deleteLibraryRatingByUserIds(Long[] userIds)
    {
        return libraryRatingMapper.deleteLibraryRatingByUserIds(userIds);
    }

    /**
     * 删除评价管理信息
     *
     * @param userId 评价管理主键
     * @return 结果
     */
    @Override
    public int deleteLibraryRatingByUserId(Long userId)
    {
        return libraryRatingMapper.deleteLibraryRatingByUserId(userId);
    }
}
